<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="${bpmTaskFrom.fromName}--${config.getKey('COMPANY_NAME')}" libs=["table"]/>
<link rel="stylesheet" href="${ctxStatic}/static/css/figol.css?V=${config.getDvVersion()}"/>
<style>
    table.table-form-title{margin:20px auto 0;}
    table.table-form-title td{text-align: center;border-bottom:0 !important;}
    table.table{width:90%;margin:0 auto;}
    table.table-form-attach{margin-bottom:100px;}
</style>
<div class="oa-form">
    <div class="form-bottom">
        <div class="form-bottom-left">
            <@f.form name="bidseal" class="form-horizontal">
            <div class="form-content">
                <div id="printBox" class="form-main" style="padding-bottom:60px;background-color:#fff;overflow-x:hidden;overflow-y: auto;">
                    <div style="margin:0 auto;">
                        <table class="table-form-title table" style="margin-top:20px;">
                            <tr>
                                <td colspan="4" style="border-bottom: 0 !important;">
                                    <h2>${config.getKey("COMPANY_NAME")}</h2>
                                    <h2>${bpmTaskFrom.fromName}</h2>
                                </td>
                            </tr>

                        </table>
                        <table class="table-form-head table table-hover table-bordered">
                            <tr>
                                <th>发起部门</th>
                                <td>
                                    <@f.tableselect readonly=true checked=false keyId="department" keyName="department" url="/bpm/project/list"
                                    labelValue="${bpmForm.projectDept}"
                                    name="department" boxTitle="项目档案" tableInfo = "[{field:'name',title:'项目档案编号'},
                                    {field:'projectName',title:'项目名称'}, {field:'department',title:'项目所属部门'},{field:'ceoName',title:'项目经理'},
                                    {field:'contractFirst',title:'委托单位'},{field:'createTime',title:'创建时间'}]" placeholder="请选择项目档案" />
                                    <div id="c_tableselect2222" class="panel-collapse collapse"></div>
                                </td>
                                <th>发起日期</th>
                                <td>
                                    <@f.input readonly=true name="createTime" value="${bpmForm.createTime?string('yyyy-MM-dd')}" type="date" dataType="datetime" dataFormat="yyyy-MM-dd"
                                    placeholder="发起日期"  butClass="fa fa-calendar-plus-o" required=true />
                                </td>
                            </tr>
                            <tr>
                                <th>项目档案编号</th>
                                <td colspan="3">
                                    <@f.input readonly=true name="projectId" value="${bpmForm.projectId}" placeholder="项目档案编号" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th>项目名称</th>
                                <td colspan="3">
                                    <@f.input readonly=true name="projectName" value="${bpmForm.projectName}" placeholder="请输入项目名称" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th>合同甲方</th>
                                <td colspan="3">
                                    <@f.input  name="departmentParty" value="" value="${bpmForm.departmentParty}" placeholder="请输入合同甲方" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th>有无地质施工</th>
                                <td>
                                    <!--<@f.select name="isBided" dictType="sys_yes_no" />-->
                                    <@f.select name="type" dictType="sys_yes_no" blankValue="${bpmForm.type}" blankLabel="${dict.getLabel('sys_yes_no', bpmForm.type)}"/>
                                </td>
                                <!--<th>中标金额(元)</th>-->
                                <!--<td>-->
                                <!--<@f.input name="bidedAmount" value="" placeholder="请输入中标金额" required=true/>-->
                                <!--</td>-->
                            </tr>
                            <tr>
                                <th>项目经理</th>
                                <td>

                                    <@f.input name="projectAdmin" value="${bpmForm.projectAdmin}" placeholder="项目经理" required=true readonly=true />
                                </td>
                                <th>项目所属部门</th>
                                <td colspan="3">
                                    <@f.tableselect checked=false keyId="department" keyName="department" url="/bpm/project/list"
                                    name="projectDept" boxTitle="项目档案" tableInfo = "[{field:'name',title:'项目档案编号'},
                                    {field:'projectName',title:'项目名称'}, {field:'department',title:'项目所属部门'},{field:'ceoName',title:'项目经理'},
                                    {field:'contractFirst',title:'委托单位'},{field:'createTime',title:'创建时间'}]" placeholder="请选择项目档案编号" />
                                </td>
                            </tr>
                            <!--<tr>-->
                            <!--<th>上传中标通知书</th>-->
                            <!--<td colspan="3">-->
                            <!--<input type="hidden" name="bidedNoticeName" value="" />-->
                            <!--<input type="hidden" name="bidedNoticeUrl" value="" />-->
                            <!--<input type="file" id="file" name="file" style="display:none;" />-->
                            <!--<div class="pull-left">-->
                            <!--<a target="_blank" name="bidedNoticeBox" href=""></a>-->
                            <!--</div>-->
                            <!--<div class="pull-right"><a onclick="showFileDlg();" href="javascript:void(0);"><i class="fa icon-link"></i></a></div>-->
                            <!--</td>-->
                            <!--</tr>-->
                            <!--<tr>-->
                            <!--<th>处理意见</th>-->
                            <!--<td colspan="3">-->
                            <!--<@f.input  name="clientCompany" value="" placeholder="请输入处理意见" required=true/>-->
                            <!--</td>-->
                            <!--</tr>-->
                            <!--<tr>-->
                            <!--<th>备注</th>-->
                            <!--<td colspan="3">-->
                            <!--<@f.input name="remark" value="" placeholder="请输入备注" required=true/>-->
                            <!--</td>-->
                            <!--</tr>-->
                        </table>
                        <table class="table-form-body table table-hover table-bordered">
                            <thead>
                            <tr>
                                <td colspan="9">
                                    <button name="btn-insert" type="button" class="btn btn-primary btn-rounded btn-sm">插入行</button>
                                    <button name="btn-copy" type="button" class="btn btn-primary btn-rounded btn-sm">复制行</button>
                                    <button name="btn-del" type="button" class="btn btn-primary btn-rounded btn-sm">删除行</button>
                                    <button name="btn-del-all" type="button" class="btn btn-primary btn-rounded btn-sm">删除全部</button>
                                    <button name="btn-import" type="button" class="btn btn-primary btn-rounded btn-sm">导入数据</button>

                                </td>
                            </tr>
                            <tr>
                                <th width="10%">序号</th>
                                <th>分类</th>
                                <th>项目类别</th>
                                <th>合同金额</th>
                            </tr>
                            </thead>

                            <tbody name="items">
                            <tr data-id="">
                                <td ><span>1 </span></td>
                                <td  style="width: 30%" >
                                    <@f.select  readonly=true name="classify" dictType="sys_bpm_classify" blankValue="" blankLabel="请选择分类"/>
                                </td>
                                <td>
                                    <@f.select readonly=true name="projectType" dictType="sys_bpm_type" blankValue="" blankLabel="请选择项目类别"/>
                                </td>
                                <td>
                                    <@f.input readonly=true name="opinion" value="" placeholder="请输入合同金额" required=true/>
                                </td>



                            </tr>
                            </tbody>
                        </table>
                        <table class="table-form-body table table-hover table-bordered">
                            <thead>
                            <tr>
                                <td colspan="9">
                                    <button name="btn-insert" type="button" class="btn btn-primary btn-rounded btn-sm">插入行</button>
                                    <button name="btn-copy" type="button" class="btn btn-primary btn-rounded btn-sm">复制行</button>
                                    <button name="btn-del" type="button" class="btn btn-primary btn-rounded btn-sm">删除行</button>
                                    <button name="btn-del-all" type="button" class="btn btn-primary btn-rounded btn-sm">删除全部</button>
                                    <button name="btn-import" type="button" class="btn btn-primary btn-rounded btn-sm">导入数据</button>

                                </td>
                            </tr>
                            <tr>
                                <th width="10%">序号</th>
                                <th width="20%">部门</th>
                                <th width="25%">合同金额合计</th>


                            </tr>
                            </thead>

                            <tbody name="items1">
                            <tr data-id="">
                                <td ><span>1 </span></td>

                                <td > <@f.input readonly=true name="opinion" value="" placeholder="请输入合同金额" required=true/></td>

                                <td><@f.input readonly=true name="openDepartment_1" value="" placeholder="备注" /></td>
                            </tr>
                            </tbody>
                        </table>
                        <table class="table-form-head table table-hover table-bordered">
                            <tr>
                                <th width="10%">建设单位</th>
                                <td >
                                    <@f.input readonly=true name="buildUnit" value="${bpmForm.buildUnit}" placeholder="请输入建设单位" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th width="10%">合同内容</th>
                                <td >
                                    <@f.input readonly=true name="contractContent" value="${bpmForm.contractContent}" placeholder="请输入合同内容" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th width="10%">合同编号</th>
                                <td >
                                    <@f.input readonly=true name="contractCode" value="${bpmForm.contractCode}" placeholder="请输入合同编号" required=true/>
                                    <button name="btn-insert" type="button" class="btn btn-primary btn-rounded btn-sm">合同编号查询</button>
                                </td>
                            </tr>
                            <tr>
                                <th width="10%">合同附件</th>
                                <td >
                                    <@f.input readonly=true name="contractUrl" value="${bpmForm.contractUrl}" placeholder="请输入合同附件" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th width="10%">项目状态</th>
                                <td >
                                    <@f.input readonly=true name="projectStatus" value="${bpmForm.projectStatus}" placeholder="请输入合同状态" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th width="10%">备注</th>
                                <td >
                                    <@f.input readonly=true name="remark" value="${bpmForm.remark}" placeholder="请输入备注" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th width="10%">处理意见</th>
                                <td >
                                    <@f.input readonly=true name="opinion" value="${bpmForm.opinion}" placeholder="请输入处理意见" required=true/>
                                </td>
                            </tr>

                        </table>
                    </div>
                </div>
            </div>

            <div class="form-attach">
                <div style="width:90%;margin:20px auto 0;background-color:#ccc;">
                    <div class="button-attach" style="height:50px;line-height:50px;font-size:14px;background-color:#ccc;">
                        <i style="padding:0 5px 0 10px;" class="icon-attach fa fa-angle-double-down">${bpmForm.attachmentText}</i>附言
                    </div>
                    <div style="width:99%;margin:0 auto;">
                        <textarea placeholder="2000字以内" style="border:1px solid #ddd;width:100%;height:70px;"></textarea>
                    </div>
                </div>
            </div>
        </@f.form>
    </div>
    <div class="form-bottom-right" style="background-color: white;">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <@f.form id="task-form-complete" class="form-horizontal">
            <div style="width:90%;margin:20px auto 0;">
                <textarea id="comment" name="message" style="height:80px;" class="form-control" required></textarea>
                <span class="help-block m-b-none" id="tipBut">
                        <i style="color: #888" class="fa fa-info-circle"> 常用词汇：</i>
                        <button type="button" class="btn btn-xs mr5">同意</button>
                        <button type="button" class="btn btn-xs mr5">已阅</button>
                    </span>
                <script>
                    $('#tipBut button').click(function(){
                        $('#comment').text($(this).text())
                    });
                </script>
            </div>
            <div style="margin:20px auto 0;text-align:center;">
                <input name="taskId" value="${taskId}" type="hidden">
                <input name="processInstanceId" value="${bpmForm.processInstanceId}" type="hidden">
                <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i> <@ctx.i18n text = "审批"/></button>&nbsp;
                <button type="button" class="btn btn-sm btn-danger" onclick="terminateHandler()"><i class="fa fa-mail-reply"></i> <@ctx.i18n text = "终止"/></button>&nbsp;
            </div>
        </@f.form>
    </div>
</div>
</div>
</div>

</div>
<@footer>
<script>jQuery.browser={};(function(){jQuery.browser.msie=false;jQuery.browser.version=0;if(navigator.userAgent.match(/MSIE ([0-9]+)./)){jQuery.browser.msie=true;jQuery.browser.version=RegExp.$1;}})();</script>
<script src="${ctxStatic}/static/js/jquery.jqprint.js"></script>
<script type="text/javascript">
    var prefix = baseURL + "bpm/bidcontract";
    function doPrint(){
        $("#printBox").jqprint();
    }
    $('form[name=bidseal]').validate({
        rules:{
            project_name:{
                required:true,
                minlength: 1,
                maxlength: 200
            },
        },
        focusCleanup: true
    });

    //提交表单，审批通过
    function submitHandler() {
        console.log(prefix)
        opt.operate.save(baseURL + "bpm/task/complete", $('#task-form-complete').serialize());
    }

    function terminateHandler() {
        console.log(prefix)
        opt.operate.save(baseURL + "bpm/task/terminate", $('#task-form-complete').serialize());
    }

    /*预览*/
    function preview(processInstanceId) {
        var options = {
            //url: baseURL + "bpm/procdef/preview/" + id,
            url: baseURL + "bpm/processInstance/preview/" + processInstanceId,
            title: '<i class="fa icon-loop"></i> <@ctx.i18n text = "流程跟踪"/>',
            btn:['<i class="fa fa-close"></i> '+$.i18n.prop("取消")],
            width: $(top.window).width() - 300,
            height: $(top.window).height() - 200
        };
        opt.modal.openMainWin(options);
    }
    /*$("button[name=btn-save]").click(function () {
        console.log("aaaaaaaaaaaa")
        if (opt.validate.form()) {
            console.log("bbbbbbbbbbbbbbbbb")
            opt.operate.post(prefix + "/add", $('form[name=bidseal]').serialize());
        }
    });*/

    $(".button-attach").click(function () {
        $(".form-attach").toggleClass("expand");
        $(".icon-attach").toggleClass("fa-angle-double-up").toggleClass("fa-angle-double-down");
    });
    layui.use('element', function(){
        var element = layui.element;

        //…
    });
</script>
</@footer>
</@pageTheme>